﻿<?php
include_once("../initial.php");
include_once(constant('PROJECT_DIR')."/logic/pageLogic.php");
if(!isset($_GET['c']))
{
	$_GET['c']="news";
}
$category = $_GET['c'];
if(!isset($_GET['pagesize']))
{
	$_GET['pagesize']=5;
}
$pageSize = $_GET['pagesize'];
if(!isset($_GET['index']) || $_GET['index']<=0)
{
	$_GET['index']=1;
}
$index = $_GET['index'];

$pageLogic = new pageLogic();

$startItem=($pageIndex-1)*$pageSize;
$pageList = $pageLogic->get_page(array('category'=>$category), "order by id desc", "limit $startItem, $pageSize");

print json_encode($pageList);
?>
